package vncjdemo;

/**
* <br><br><center><table border="1" width="80%"><hr>
* <strong><a href="http://www.amherst.edu/~tliron/vncj">VNCj</a></strong>
* <p>
* Copyright (C) 2000-2002 by Tal Liron
* <p>
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* <a href="http://www.gnu.org/copyleft/lesser.html">GNU Lesser General Public License</a>
* for more details.
* <p>
* You should have received a copy of the <a href="http://www.gnu.org/copyleft/lesser.html">
* GNU Lesser General Public License</a> along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* <hr></table></center>
**/

import gnu.vnc.awt.swing.*;
import gnu.awt.virtual.*;

import java.awt.*;

public class AWTModelTest extends VNCDesktop
{
	//
	// Construction
	//
	
	public AWTModelTest( int display, String displayName )
	{
		super( displayName, 640, 480 );

		addFrame();
		addFrame();
		addFrame();
	}
	
	///////////////////////////////////////////////////////////////////////////////////////
	// Private

	private int openFrameCount = 0;
	private int xOffset = 30, yOffset = 30;
	
	private void addFrame()
	{
		// Create frame
		Frame frame = null;
		synchronized(ToolkitFrame.class){
			ToolkitFrame.defaultToolkit = this;
			frame = new ToolkitFrame( "Editor [" + openFrameCount + "]" );
		}
		//frame = new Frame("Editor [" + openFrameCount + "]");
		frame.setLocation( xOffset * openFrameCount, yOffset * openFrameCount++ );
		frame.setSize( 300, 200 );
		
		// Populate it
		TextArea text = new TextArea( "This is an AWT Frame\ncontaining an AWT TextArea." );
		frame.add( text );
		
		// Show it
		frame.show();
	}
}

